﻿@model dynamic
@{
    var action = ViewContext.RequestContext.AllRouteValues()["action"].ToString(); 
}
<div class="searchbox">
    <form action="@Html.Raw(Url.Action(action, ViewContext.RequestContext.AllRouteValues().Merge("page", "1")))" method="get" class="no-stop">
        @foreach (var key in Request.QueryString.AllKeys)
        {
            if (key.Equals("search", StringComparison.OrdinalIgnoreCase) || key.Equals("page", StringComparison.OrdinalIgnoreCase)) { continue; }
            @Html.Hidden(key, Request.QueryString[key])
        }
        <input type="text" name="search" value="@Html.Raw(ViewContext.RequestContext.GetRequestValue("search"))" onkeydown="if (event.keyCode == 13) { this.form.submit(); return false; }"/>
        <button type="submit">
            @Html.IconImage("search")</button>
    </form>
</div>
